/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License Version
 *  3 as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
 *  USA.
 */
#include <optra/zoneinfo.h>

using namespace Optra;

class Optra::ZoneWindowPrivate{
public:
    ZoneWindowPrivate(){};
    ~ZoneWindowPrivate(){}
    QMenu* menu;
    QIcon icon;
    QString id;
    QString display;
    GuiWindow* widget;
    QWidget* toolbar;

};

ZoneWindow::ZoneWindow(const QString& id, const QString& display, GuiWindow* w, QWidget* toolbar/* = 0*/)
    :O_PRIVATE_CREATE(ZoneWindow)
{
    O_D(ZoneWindow);
    d->id = id;
    d->display = display;
    d->widget = w;
    d->toolbar = toolbar;
}

ZoneWindow::~ZoneWindow()
{
    O_PRIVATE_DELETE;
}


QWidget* ZoneWindow::toolbar()
{
    O_D(ZoneWindow);
    return d->toolbar;
}

const QIcon& ZoneWindow::icon()const
{
    O_D(const ZoneWindow);
    return d->icon;
}

QString ZoneWindow::id()const
{
    O_D(const ZoneWindow);
    return d->id;
}

QString ZoneWindow::display()const
{
    O_D(const ZoneWindow);
    return d->display;
}

GuiWindow* ZoneWindow::widget()
{
    O_D(ZoneWindow);
    return d->widget;
}

void  ZoneWindow::setIcon(const QIcon& icon)
{
    O_D(ZoneWindow);
    d->icon = icon;
}

//////////////////////////////////////////

class Optra::ZoneInfoPrivate{
public:
    ZoneInfoPrivate(){}
    ~ZoneInfoPrivate(){}
    QString name;
    QString id;

    QIcon icon;

    ZoneInfo::ViewsList views;
    ZoneInfo::ToolsList tools;
};

ZoneInfo::ZoneInfo(const QString& id, const QString& name):
        O_PRIVATE_CREATE(ZoneInfo)

{
    O_D(ZoneInfo);
    d->id = id;
    d->name = name;
}

ZoneInfo::~ZoneInfo()
{
    O_PRIVATE_DELETE;
}


QString ZoneInfo::id()const
{
    O_D(const ZoneInfo);
    return d->id;
}

QString ZoneInfo::name()const
{
    O_D(const ZoneInfo);
    return d->name;
}

void ZoneInfo::addView(ZoneWindow* view)
{
    O_D(ZoneInfo);
    d->views.append(view);
}

void ZoneInfo::addTool(ZoneWindow* tool)
{
    O_D(ZoneInfo);
    d->tools.append(tool);
}

ZoneInfo::ViewsList ZoneInfo::views()
{
    O_D(ZoneInfo);
    return d->views;
}

ZoneInfo::ToolsList ZoneInfo::tools()
{
    O_D(ZoneInfo);
    return d->tools;
}


QIcon ZoneInfo::icon()
{
    O_D(const ZoneInfo);
    return d->icon;
}

void ZoneInfo::setIcon(const QIcon& icon)
{
    O_D(ZoneInfo);
    d->icon = icon;
}
